-
The proxy object for the current map style.
MGLStyle provides a set of convenience methods for changing Mapbox default styles using
MGLMapView.styleURL
. Learn more about Mapbox default styles.It is also possible to directly manipulate the current map style via
MGLMapView.style
by updating the style’s data sources or layers.Note
Wait until the map style has finished loading before modifying a map’s style via any of theMGLStyle
instance methods below. You can use the-[MGLMapViewDelegate mapView:didFinishLoadingStyle:]
or-[MGLMapViewDelegate mapViewDidFinishLoadingMap:]
methods as indicators that it’s safe to modify the map’s style.Related examples
See the Default styles example to learn how to initialize an
See moreMGLMapView
object with a Mapbox default style usingMGLStyle
‘s class methods.Declaration
Objective-C
@interface MGLStyle : NSObject
Swift
class MGLStyle : NSObject
-
An
MGLLight
object represents the light source for extruded geometries inMGLStyle
.Example
let light = MGLLight() let position = MGLSphericalPosition(radial: 5, azimuthal: 180, polar: 80) light.position = NSExpression(forConstantValue: NSValue(mglSphericalPosition: position)) light.anchor = NSExpression(forConstantValue: "map") mapView.style?.light = light
Related examples
See the Adjust light of 3D buildings to learn how to create and modify the light source for 3D geometries.
See moreDeclaration
Objective-C
@interface MGLLight : NSObject
Swift
class MGLLight : NSObject